# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openimagedenoise
pkgver=2.1.0
pkgrel=0
pkgdesc="Intel Open Image Denoise library"
url="https://www.openimagedenoise.org/"
arch="x86_64" # openimagedenoise only really supports x86_64
license="Apache-2.0"
makedepends="cmake python3 onetbb-dev ispc samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenImageDenoise/oidn/releases/download/v$pkgver/oidn-$pkgver.src.tar.gz"
builddir="$srcdir/oidn-$pkgver"
options="!check" # doesn't have a test suite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_RPATH=ON \
		-DOIDN_APPS=OFF

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
508cb100f1a0a825774c2c01e0fc983e697341745fa0bfa48a99bfa70fc431f66fcdf17c3f170e40baefd7c3796a25d147f49cb17efbf1a1886556367c5c4566  openimagedenoise-2.1.0.tar.gz
"
